/*
 * Shape.cpp
 *
 *  Created on: Jan 5, 2014
 *      Author: nick
 */

//Header files
#include "Sprite.h"

Sprite::Sprite() {
	box.x = 0;
	box.y = 0;

	//Initialize the velocity
	yVel = 0;
	xVel = 0;

	type = 0;
}

Sprite::~Sprite() {
}

void Sprite::print() {
	//Output both (x,y) coordinates
	cout << endl;
}

bool Sprite::isWithin(int x, int y) {
	if (x < box.x || x > box.x + box.w)
		return false;

	if (y < box.y || y > box.y + box.h)
		return false;

	return true;
}
;

void Sprite::show(int x, int y, SDL_Surface* source, SDL_Surface* destination,
		SDL_Rect* image = NULL) {
	//Holds offsets
	SDL_Rect offset;

	//Get offsets
	offset.x = x;
	offset.y = y;

	//Blit
	SDL_BlitSurface(source, image, destination, &offset);
}

int Sprite::getX() {
	return box.x;
}

int Sprite::getY() {
	return box.y;
}

int Sprite::getType() {
	return type;
}

SDL_Rect Sprite::getBox() {
	return box;
}

